<template>
  <div>
    <el-container class="home_container">
      <el-header>
        <div>校园服务平台后台管理系统</div>
        <el-button type="info" @click="logout">退出登录</el-button>
      </el-header>
      <el-container>
        <el-aside width="200px">
          <el-menu :default-active="$route.name">
            <router-link to="/count">
              <el-menu-item index="1">
                <i class="el-icon-s-data"></i>
                <span slot="title">统计</span>
              </el-menu-item>
            </router-link>
            <router-link to="/topic">
              <el-menu-item index="2">
                <i class="el-icon-document"></i>
                <span slot="title">贴子</span>
              </el-menu-item>
            </router-link>
            <router-link to="/goods">
              <el-menu-item index="3">
                <i class="el-icon-goods"></i>
                <span slot="title">商品</span>
              </el-menu-item>
            </router-link>
            <router-link to="/user">
              <el-menu-item index="4" >
                <i class="el-icon-user"></i>
                <span slot="title">用户</span>
              </el-menu-item>
            </router-link>
            <router-link to="/news">
              <el-menu-item index="5">
                <i class="el-icon-s-promotion"></i>
                <span slot="title">校园资讯</span>
              </el-menu-item>
            </router-link>
          </el-menu>
        </el-aside>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  data () {
    return {
    }
  },
  methods: {
    // 退出登录
    logout () {
      this.$router.push('/login')
    }
  }
}
</script>

<style lang="less" scoped>
div {
  height: 100%;
}
.home_container {
  height: 100%;
}
.el-header {
  background-color: #373d41;
  display: flex;
  justify-content: space-between;
  align-items: center;
  div {
    display: flex;
    align-items: center;
    font-size: 20px;
    color: white;
  }
}
.el-main {
  background-color: #eaedf1;
}
.el-menu {
  background-color:whitesmoke;
}
.el-aside {
  background-color:whitesmoke;
   color: #fff;
   span {
     font-size: 16px;
   }
}
.el-aside {
  font-size: 20px;
}

.el-menu-item.is-active {
  background-color:whitesmoke;
}
.el-menu-item:hover{
  background-color:whitesmoke ;
}
</style>
